<template>
<div class="main-box">
    <van-nav-bar
            title="全部评价"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
    />
    <div class="evaluate" style="width:90%; margin-left: auto;margin-right: auto">

            <template v-for="(item,i) in eva.slice(0,3)">
                <div style="margin-top:20px;">
                <van-row gutter="20" :key="i">
                    <van-col span="4"> <van-image
                            round
                            width="50px"
                            height="50px"
                            src="https://img01.yzcdn.cn/vant/cat.jpeg"
                    /></van-col>
                    <van-col span="20"><label style="font-size: 14px">{{item.userName}}</label><br>
                        <label  style="font-size:12px">{{item.message}}</label></van-col>
                </van-row>
                </div>
            </template>

    </div>
</div>
</template>

<script>
    import {getGoodsDetail} from "@/api/api";
    import {Toast} from "vant";

    export default {
        name: "evaluate",
        data(){
            return{
                eva:[],
                gid:"",
            }
        },
        created() {
            this.gid=this.$route.query.gid
            getGoodsDetail(this.gid).then((response) => {
                if(response.data.code===2000){
                    this.eva=response.data.data.evaList
                }else{
                    Toast(response.data.message);
                }
            });

        },
        methods: {
             onClickLeft() {
                 this.$router.go(-1);
             },
         }
    }
</script>

<style scoped>

</style>